package org.example.exampreparationtreasure.common;

/**
 * 错题相关业务状态码枚举
 */
public enum IncorrectQuestionResultStatus implements ResultStatus {
    
    // 错题记录相关错误码 (2000-2099)
    INCORRECT_QUESTION_NOT_FOUND(2001, "错题记录不存在"),
    INCORRECT_QUESTION_ALREADY_EXISTS(2002, "错题记录已存在"),
    INCORRECT_QUESTION_ADD_FAILED(2003, "添加错题记录失败"),
    INCORRECT_QUESTION_UPDATE_FAILED(2004, "更新错题记录失败"),
    INCORRECT_QUESTION_DELETE_FAILED(2005, "删除错题记录失败"),
    
    // 参数验证相关错误码 (2100-2199)
    INVALID_USER_ID(2101, "用户ID无效"),
    INVALID_QUESTION_ID(2102, "题目ID无效"),
    INVALID_CATEGORY_ID(2103, "分类ID无效"),
    INVALID_MISTAKE_REASON(2104, "错误原因无效"),
    INVALID_PAGE_PARAMS(2105, "分页参数无效"),
    
    // 业务逻辑相关错误码 (2200-2299)
    USER_NOT_EXISTS(2201, "用户不存在"),
    QUESTION_NOT_EXISTS(2202, "题目不存在"),
    CATEGORY_NOT_EXISTS(2203, "分类不存在"),
    NO_PERMISSION_TO_ACCESS(2204, "无权限访问该错题记录"),
    
    // 数据库操作相关错误码 (2300-2399)
    DATABASE_OPERATION_FAILED(2301, "数据库操作失败"),
    QUERY_TIMEOUT(2302, "查询超时"),
    CONNECTION_FAILED(2303, "数据库连接失败");

    private final int code;
    private final String message;

    IncorrectQuestionResultStatus(int code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public int getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }
}
